package com.yanqu.road.server.cmd.cricket;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cricket.CricketProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cricketcourt.CrossCricketCourtMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_CRICKET_SYNC_DATA, desc = "蛐蛐跨服数据同步")
public class CrossSyncCricketDataCmd extends CrossCommand {
    long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CricketProto.CrossCricketSyncDataReqMsg reqMsg = CricketProto.CrossCricketSyncDataReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossCricketCourtMgr.crossCricketSyncData(serverId, userId);
    }

    @Override
    public void sendData() {

    }
}
